package com.yaoq.singleton;

/**
 * @ClassName StaticInnerSingleton
 * @Description TODO
 * @Author yaoqiang
 * @Date 2020/9/1 18:08
 * @Version 1.0
 */
public class StaticInnerSingleton {
    private static volatile StaticInnerSingleton instance;

    public StaticInnerSingleton() {
    }

    private static class SingleInstance {
        private static final StaticInnerSingleton INSTANCE = new StaticInnerSingleton();
    }

    public static synchronized StaticInnerSingleton getInstance() {
        return SingleInstance.INSTANCE;
    }
}
